﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DayuCode.Designer.Entity
{
    public class HDataColumn
	{
		public long? Id { get; set; }
		public string ColumnName { get; set; }
		public string JavaType { get; set; }
		public string ColumnCaption { get; set; }
		public string ColumnAliasName { get; set; }
		public string DataType { get; set; }
		public int? Ordnum { get; set; }
		public int? DataLength { get; set; }
		public string CharsetType { get; set; }
		public int? MinCharLength { get; set; }
		public string Unit { get; set; }
		public int? MaxCharLength { get; set; }
		public int? DataScale { get; set; }
		public double? MinValue { get; set; }
		public double? MaxValue { get; set; }
		public long? DatatableId { get; set; }
		public string CodeType { get; set; }
		public string RefTableName { get; set; }
		public string ColumnType { get; set; }
		public string CreateUser { get; set; }
		public bool? IsKeyColumn { get; set; }
		public bool? JsonIgnore { get; set; }
		public string RefColumnInfo { get; set; }
		public bool? IsRefColumn { get; set; }
		public bool? IsUniqueColumn { get; set; }
		public string CreateTimeStr { get; set; }
		public string PropName { get; set; }
		public int? ValueUnique { get; set; }
		public string VarName { get; set; }
		public string ColumnTypeCaption { get; set; }
		public string RefNameColumnName { get; set; }
		public string DefaultCellTextType { get; set; }
		public string DefaultInputElementType { get; set; }

		public string RefIdColumn { get; set; }
		public string RefNameColumn { get; set; }
		public string RefNameColumnPropName { get; set; }
		public string RefNameColumnVarName { get; set; }
		public string RefNameColumnAliasName { get; set; }

		public bool Selected { get; set; }

		public string DatasetName { get; set; }

        public override string ToString()
        {
			if (string.IsNullOrWhiteSpace(ColumnName)) return "";
			if (string.IsNullOrWhiteSpace(ColumnCaption) || ColumnCaption.Equals(ColumnName,StringComparison.CurrentCultureIgnoreCase)) return ColumnName;
			return ColumnName + "(" + ColumnCaption + ")";
        }
    }
}
